import { EntityModel } from '@midwayjs/orm';
import { Column, PrimaryGeneratedColumn } from 'typeorm';
import dayjs from 'dayjs';
@EntityModel({
  name: 'friend_apply',
})
export class FriendApplyEntity {
  @PrimaryGeneratedColumn({
    type: 'bigint',
    comment: '主键id',
  })
  id: number;

  @Column({
    type: 'int',
    name: 'user_id',
    nullable: false, // 不能为null
    comment: '用户id',
  })
  userId: number;

  @Column({
    type: 'int',
    name: 'friend_id',
    nullable: false, // 不能为null
    comment: '好友id',
  })
  friendId: number;

  @Column({
    type: 'varchar',
    name: 'user_name',
    length: 50,
    nullable: false, // 不能为null
    comment: '用户名称',
  })
  userName: string;

  @Column({
    type: 'varchar',
    name: 'friend_name',
    length: 50,
    nullable: false, // 不能为null
    comment: '好友名称',
  })
  friendName: string;

  @Column({
    type: 'varchar',
    name: 'user_image',
    length: 50,
    nullable: false, // 不能为null
    comment: '用户头像',
  })
  userImage: string;

  @Column({
    type: 'varchar',
    name: 'friend_image',
    length: 50,
    nullable: false, // 不能为null
    comment: '好友头像',
  })
  friendImage: string;

  @Column({
    type: 'varchar',
    length: 50,
    nullable: false, // 不能为null
    comment: '消息',
  })
  msg: string;

  @Column({
    type: 'int',
    nullable: false, // 不能为null
    comment: '状态',
  })
  status: number; // 1: 已经是好友；2: 申请添加好友；3: 拒绝添加好友

  @Column({
    type: 'varchar',
    name: 'create_time',
    length: 20,
    nullable: false, // 不能为null
    default: dayjs().format('YYYY-MM-DD HH:mm:ss'), // 默认值
    comment: '创建时间',
  })
  createTime: string;
}
